#include "server.h"
#include "widget.h"

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    HttpServer* httpServer = HttpServer::getInstance();
    if(!httpServer->init()) {
        qDebug() << "HTTP 服务器启动失败!";
        return 1;
    }
    qDebug() << "HTTP 服务器启动成功!";

    WebSocketServer* webServer = WebSocketServer::getInstance();
    if(!webServer->init()) {
        qDebug() << "WebSocket 连接失败!";
        return 2;
    }
    qDebug() << "WebSocket 连接成功!";

    Widget w;
    w.show();
    return a.exec();
}
